class Solution {
public:
    int countSymmetricIntegers(int low, int high) {
        
        int ret=0;
        for(int i=low;i<=high;++i){

            string num=to_string(i);
            if(num.size()&1){

                continue;
            }
            int sum=0,pre=0;
            for(int j=0;j<num.size();++j){

                sum+=num[j]-'0';
                if(j<num.size()/2){

                    pre+=num[j]-'0';
                }
            }
            if(pre==sum-pre){

                //cout<<i<<' '<<pre<<' '<<sum-pre<<endl;
                ret++;
            }
        }
        return ret;
    }
};
